package com.peng.service;

import com.peng.mapper.LinkMapper;
import com.peng.pojo.Link;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LinkServiceImp implements LinkService {
    @Autowired
    private LinkMapper linkMapper;

    @Override
    public List<Link> selectAll() {
        return linkMapper.selectAll();
    }

    @Override
    public boolean addLink(Link link) {
        if (link != null) {
            linkMapper.addLink(link);
        }
        return true;
    }

    @Override
    public boolean updateLink(Link link) {
        if (link != null) {
            linkMapper.updateLink(link);
        }
        return true;
    }

    @Override
    public boolean deleteLinkById(int id) {
        linkMapper.deleteLinkById(id);
        return true;
    }
}
